package lambda.steam;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class test {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("abc");
        list.add("bcd");
        list.add("abcd");
        list.add("aaaa");
        list.add("bbdc");
        list.add("acba");
        list.add("dsaqd");
        list.add("drd");
        System.out.println(list.stream().allMatch(s -> s.startsWith("d")));
        System.out.println(list.stream().min((s1, s2) -> s1.compareTo(s2)));
        System.out.println(list.stream().count());
        list.stream().filter(s -> s.startsWith("a")).forEach(s -> System.out.println(s));
        list.stream().filter(s -> s.length() == 3).forEach(s -> System.out.println(s));
    }
}
